<html>
    <head>
        <script type="text/javascript" src="jquery-1.7.2.js"></script>
		<script type='text/javascript'>
        	$(document).ready(function(){
				var id = $("select#groups option:selected").attr('value');
				$("#groups").change(function(){
					$.post("select_type.php", {id:id}, function(data){
						$('#studenttable > tbody').replaceWith(data);
					});

				});
				
				$("#input#btnSubmit").click(function() {
					$("bdyStudents td").each(function(i,o){
						var value = ( $(":first-child", this).is(":input") ) 
						? $(":first-child", this).val() 
						: ( $(this).text() != "" ) 
						? $(this).text() 
						: $(this).html() ;
						alert(value);
					});
				});
	        });
			
        </script>
    </head>
    
	<body>
	<?php include "select.class.php"; ?>
 
        	Select Group to Review:<br />
	        <select id="groups" class ="groups">
        	    <?php echo $opt->GetGroups(); ?>
	        </select>
	        <br /><br />
        <div id="result"></div>
		<div id="studenttablediv">
		<table id="studenttable">
		<thead>
		<th>Firstname</th><th>StudentKey</th><th>Percentage</th><th>Remarks</th>
		</thead>
		<tbody>
		</tbody>
		</table>
		<input type="button" value="confirm" id="btnSubmit"/>
    </body>
</html>